package com.ruoyi.swla2.service.impl;

import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.swla2.mapper.ReadingHistoryDataYcMapper;
import com.ruoyi.swla2.domain.ReadingHistoryDataYc;
import com.ruoyi.swla2.service.IReadingHistoryDataYcService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
/**
 * 小-抄数据(远传)Service业务层处理
 * 
 * @author gdqt
 * @date 2025-04-19
 */
@Service
public class ReadingHistoryDataYcServiceImpl extends ServiceImpl<ReadingHistoryDataYcMapper, ReadingHistoryDataYc> implements IReadingHistoryDataYcService
{
    @Autowired
    private ReadingHistoryDataYcMapper readingHistoryDataYcMapper;

    /**
     * 查询小-抄数据(远传)
     * 
     * @param ID 小-抄数据(远传)主键
     * @return 小-抄数据(远传)
     */
    @Override
    public ReadingHistoryDataYc selectReadingHistoryDataYcByID(Long ID)
    {

        return null;//readingHistoryDataYcMapper.selectByID(ID);
    }

    /**
     * 查询小-抄数据(远传)列表
     * 
     * @param readingHistoryDataYc 小-抄数据(远传)
     * @return 小-抄数据(远传)
     */
    @Override
    public List<ReadingHistoryDataYc> selectReadingHistoryDataYcList(ReadingHistoryDataYc readingHistoryDataYc)
    {
        LambdaQueryWrapper<ReadingHistoryDataYc> queryWrapper = new LambdaQueryWrapper<>();
        if(StringUtils.isEmpty(readingHistoryDataYc.getTerminalID())){
            queryWrapper.eq(ReadingHistoryDataYc::getTerminalID,readingHistoryDataYc.getTerminalID());
        }
        if(StringUtils.isEmpty(readingHistoryDataYc.getTenantId())){
            queryWrapper.eq(ReadingHistoryDataYc::getTenantId,readingHistoryDataYc.getTenantId());
        }
        if(readingHistoryDataYc.getTotalFlow() != null){
            queryWrapper.eq(ReadingHistoryDataYc::getTotalFlow,readingHistoryDataYc.getTotalFlow());
        }
        if(readingHistoryDataYc.getCreateDate() != null){
            queryWrapper.eq(ReadingHistoryDataYc::getCreateDate,readingHistoryDataYc.getCreateDate());
        }
        if(readingHistoryDataYc.getReadDate()!=null){
            queryWrapper.eq(ReadingHistoryDataYc::getReadDate,readingHistoryDataYc.getReadDate());
        }
        if(readingHistoryDataYc.getForwardFlow() != null){
            queryWrapper.eq(ReadingHistoryDataYc::getForwardFlow,readingHistoryDataYc.getForwardFlow());
        }
        if(readingHistoryDataYc.getReverseFlow() != null){
            queryWrapper.eq(ReadingHistoryDataYc::getReverseFlow,readingHistoryDataYc.getReverseFlow());
        }
        if(readingHistoryDataYc.getInstantFlow() != null){
            queryWrapper.eq(ReadingHistoryDataYc::getInstantFlow,readingHistoryDataYc.getInstantFlow());
        }
        if(StringUtils.isEmpty(readingHistoryDataYc.getEasIonID())){
            queryWrapper.eq(ReadingHistoryDataYc::getEasIonID,readingHistoryDataYc.getEasIonID());
        }
        return readingHistoryDataYcMapper.selectList(queryWrapper);
    }

    /**
     * 新增小-抄数据(远传)
     * 
     * @param readingHistoryDataYc 小-抄数据(远传)
     * @return 结果
     */
    @Override
    public int insertReadingHistoryDataYc(ReadingHistoryDataYc readingHistoryDataYc)
    {
        return readingHistoryDataYcMapper.insert(readingHistoryDataYc);
    }

    @Override
    public int updateReadingHistoryDataYc(ReadingHistoryDataYc readingHistoryDataYc) {
        return 0;
    }

    @Override
    public int deleteReadingHistoryDataYcByIDs(Long[] IDs) {
        return 0;
    }

    @Override
    public int deleteReadingHistoryDataYcByID(Long ID) {
        return 0;
    }


}
